package com.snopy.user.service;

import com.snopy.user.pojo.Users;
import com.snopy.user.pojo.bo.UserBO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @author snoopy
 * @date 2020/9/19 0019 14:58
 * @email 77912204@qq.com
 * @remark
 */
@FeignClient("snopy-user-service")
@RequestMapping("user-api")
public interface UserService {
    /**
     * 判断用户名是否存在
     */
    @GetMapping("checkUsername")
    public boolean queryUsernameIsExist(@RequestParam("username") String username);

    /**
     * 创建用户
     */
    @PostMapping("addUser")
    public Users createUser(@RequestBody UserBO userBO);

    /**
     * 检索用户名和密码是否匹配，用于登录
     */
    @PostMapping("queryUserInfo")
    public Users queryUserForLogin(@PathVariable("username") String username,
                                   @PathVariable("password") String password);
}
